package com.zhijian.wharf.controller.web;

import com.zhijian.response.annotation.Response;
import com.zhijian.util.page.Page;
import com.zhijian.wharf.entity.vo.request.DatabaseDeleteSearchVo;
import com.zhijian.wharf.entity.vo.response.DatabaseDeleteVo;
import com.zhijian.wharf.service.DatabaseDeleteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 数据库清理 控制层
 *
 * @author auto
 * @version 1.0
 * @date 2024-08-16 17:15:37
 */
@Slf4j
@Controller
@Api(tags = "数据库清理")
public class DatabaseDeleteController {

    @Autowired
    private DatabaseDeleteService service;

    /**
     * 分页查询
     *
     * @param param
     * @return
     */
    @Response
    @PostMapping("/database/delete/page")
    @ApiOperation("分页查询")
    public Page<DatabaseDeleteVo> selectByCondition(@RequestBody(required = false) DatabaseDeleteSearchVo param) {
        if (param == null)
            param = DatabaseDeleteSearchVo.builder().build();
        log.info("{} - {}| query info", this.getClass().getSimpleName(), param);
        return service.selectPage(param);
    }

}